-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Fix auto-scroll failing when components are dynamically added to chat #7820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Added MutationObserver to watch for dynamically added DOM elements - Changed from observing only direct children to observing all descendants - New elements and their children are automatically observed when added - This ensures auto-scroll works when components pop into the chat, not just text Generated with [Continue](https://continue.dev) Co-Authored-By: Continue <[email protected]>
|
@Patrick-Erichsen I can do a preliminary review, I kicked this off |
Possible fix for #8004 ? |
@chezsmithy yes! Actually hadn't merged this because was having issues replicating, that issue is helpful |
@RomneyDa i see the issue when a terminal near the bottom of the chat window pushes below the bottom and shortens, or when a create file near the bottom streams past the bottom. |
This PR fixes the auto-scroll issue where the chat would fail to stay anchored to the bottom when components dynamically appear in the chat (e.g., tool outputs, inline elements).
Changes
Problem Solved
Previously, the auto-scroll only observed immediate children of the chat container. When components like tool outputs or other inline elements were dynamically added, they weren't being observed by the ResizeObserver, so their height changes didn't trigger the auto-scroll behavior. This fix ensures all dynamically added elements are observed, maintaining the anchor-to-bottom behavior even when complex components pop into the chat.
Summary by cubic
Keep the chat anchored to the bottom when dynamic components (tool outputs, inline elements) are added.